
int  writein()
{
 FILE *fp;//打开成绩文件
       
        	if(IsFile==1){
	 	 if((fp=fopen(thein.final,"w"))==NULL)// 写完文件result/用户名_题号_内存占用量_时间限制_内存限制_执行编号
        	{  printf("w");
               printf(SYSTEMERR);
           	   return 0;
        	}
		fprintf(fp,"{'runid':'%s',",theout.runid);        
        	fprintf(fp,"'user':'%s',",theout.user);
        	fprintf(fp,"'problem':'%s',",theout.pro);
        	fprintf(fp,"'result':'%s',",theout.result);
        	fprintf(fp,"'memery':'%d',",theout.memery);
        	fprintf(fp,"'time':'%f',",theout.time);
	  	fprintf(fp,"'language':'%s',",theout.la);
        	fprintf(fp,"'length':'%d',",theout.len);
        	fprintf(fp,"'submittime':'%d'}",theout.submittime);
        	
        	fclose(fp);
        	}
            else{
            printf("{'runid':'%s',",theout.runid);        
        	printf("'user':'%s',",theout.user);
        	printf("'problem':'%s',",theout.pro);
        	printf("'result':'%s',",theout.result);
        	printf("'memery':'%d',",theout.memery);
        	printf("'time':'%f',",theout.time);
	  	printf("'language':'%s',",theout.la);
        	printf("'length':'%d',",theout.len);
        	printf("'submittime':'%d'}",theout.submittime);
              }
        return 0;
    
}
 